<?php

// params: instance, direction = h|v

include_once($cfgPaths['mod'].'mod_banner/lib/dbaSubscription.o.inc.php');
include_once($cfgPaths['mod'].'mod_banner/etc/conf.inc.php');

$subscrdba = new dbaSubscription($udba); 

$banners = $subscrdba->getRandomOrderByInstance($params['instance']);

if ($params['direction'] == 'h')
{
    for ($i = 0; $i < count($banners); $i++)
    {
        print '<a href="'.$banners[$i]['url'].'"><img border="0" src="'.$cfgPaths['BannerUrl'].
            $banners[$i]['id'].$udba->get_imgextension($banners[$i]['type']).'"/></a> ';
    }
}
else
{
    for ($i = 0; $i < count($banners); $i++)
    {
        print '<a href="'.$banners[$i]['url'].'"><img border="0" src="'.$cfgPaths['BannerUrl'].
            $banners[$i]['id'].$udba->get_imgextension($banners[$i]['type']).'"/></a><br/><br/>';
    }
}

?>